#pragma once

#include <list>
#include "Obstacle.h"
#include "Vehicle.h"

namespace Pathing
{
	struct PathingPacket
	{
		Maths::Vector3D start, end;
		void operator()(const Maths::Vector3D& start, const Maths::Vector3D& end)
		{
			this->start = start;
			this->end = end;
		}
		float Length() const
		{
			return (end - start).Magnitude();
		}
	};
	enum State
	{
		NO_INTERSECTION = 0,
		SINGLE_INTERSECTION,
		SIMULTANEOUS_INTERSECTION,
	};

	bool LOSVehicleNextNode( Vehicle& vehicle, const Obstacle::Vector_t& obstacles );
	bool GetPathofVehicleToDestination( Vehicle& vehicle, const Obstacle::Vector_t& obstacles, float& costOfPath, std::list<Maths::Vector3D>& path, const unsigned int maxDepth, const unsigned int depth = 0 );
	bool TestPath( const PathingPacket& path, const float vehicleRadius, const Obstacle::Vector_t& obstacles, float& costOfPath, std::list<Maths::Vector3D>& pathSoFar, const unsigned int maxDepth, const unsigned int depth );
	bool VehicleObstacleTest( const Vehicle& vehicle, const Obstacle& obstacle );
	void GetAdjustedPaths( const PathingPacket& path, const float vehicleRadius, const Obstacle& closestObstacle, const Maths::Vector3D& obstacleToPath, const Maths::Vector3D& closestPoint, PathingPacket* path1, PathingPacket* path2 );
};